﻿@model Model.OriginalRecord.E_tb_RecordSample
@{
    ViewBag.Title = "OriginalRecordReport";
}


<!DOCTYPE html>

<head>
    <meta name="viewport" content="width=device-width" />
    <title>原始记录列表</title>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/default/easyui.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/icon.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/demo.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/uploader/uploadify.css")' />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/Validform/style.css")'  />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/Validform/style.css")'  />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Content/XINDECSS/MainStyle.css")'/>
    <script type="text/javascript" src='/Scripts/jquery-1.8.2.min.js'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/jquery.easyui.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/jquery.uploadify.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/swfobject.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftMvcAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/Validform/Validform_v5.3.2_min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/My97DatePicker/WdatePicker.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/kindeditor/kindeditor-min.js")'></script>
    <script src="/Scripts/Highcharts/highcharts.js" type="text/javascript"></script>
    <script src="/Scripts/Highcharts/modules/exporting.js" type="text/javascript"></script>
    <script src="/Scripts/ReportJs.js" type="text/javascript"></script>

    <style type="text/css">
        .ReportTitle{ width:100%; height:30px; line-height:30px; text-align:center; font-size:16px; font-weight:bold;}
        .MainTable {width:99.9%; margin:0px auto; background-color:#95B8E7;}
        .MainTable td{ background-color:#fff;}
        .SampleList{width:100%; height:500px; overflow-x:hidden;  overflow-y:auto;}
        .SampleList h2{ width:100%; height:25px; line-height:25px; text-align:center; font-size:12px; font-weight:bold; background-color:#e7f4fd; border-bottom:1px solid #95B8E7;}
        .SampleList li{ width:100%; height:24px; line-height:24px; text-align:left; text-indent:1em; border-bottom:1px solid #95B8E7;}
        .SampleList li:hover{background-color:#e7f4fd;}
    </style>

    <!--页面数据处理-->
    <script type="text/javascript">
        $(document).ready(function () {
            $("#ProjectID").change(function () {
                var ProjectID = $(this).val();
                window.location.href = '/DataReport/OriginalRecordReport?ProjectID=' + ProjectID;
            });
        });

        //报表统计
        function Report() {
            if (!IsV()) {
                return;
            }
            var ProjectID = $("#ProjectID").val();
            var StartTime = $("#txt_StartTime").val();
            var EndTime = $("#txt_EndTime").val();
            var RecordSampleIDS = "";
            $(".SampleList input:checked").each(function () {
                RecordSampleIDS += $(this).val() + ",";
            });

            $.ajax({
                url: '/DataReport/Report?ProjectID=' + ProjectID + "&StartTime=" + StartTime + "&EndTime=" + EndTime + "&RecordSampleIDS=" + RecordSampleIDS,
                type: "GET",
                success: function (data) {
                    DataBangding(data.XName, data.YData);
                }
            });
        }

        //查询验证
        function IsV() {
            var b = true;
            if ($("#ProjectID").val() == "-1") {
                alert("请选择项目！");
                b = false;
            }

            if ($("#txt_StartTime").val() == "") {
                alert("请选择起始时间！");
                b = false;
            }

            if ($("#txt_EndTime").val() == "") {
                alert("请选择结束！");
                b = false;
            }

            if ($(".SampleList input:checked").length < 1) {
                alert("请选择样品！");
                b = false;
            }
            return b;
        }
        
    </script>

</head>
<body>
    <!--标题-->
    <table cellpadding="0" cellspacing="0" width="100%" class="HeadTitle">
        <tr>
            <td>当前位置：原始记录<img style="text-align:center;vertical-align:middle;height:10px" src='@Url.Content("~/Content/Images/位置.png")' />数据统计 </td>
        </tr>
    </table>
    <div class="ReportTitle">原始记录数据统计</div>

     <!--数据列表-->
    <div class="divList">
        <table cellpadding="0" cellspacing="0" width="100%" class="WhereTable">
            <tr>
                <td align="right"style="width:70px;">项目名称：</td>
                <td align="left" style="width:120px;" >@Html.DropDownListFor(m => m.ProjectID, ViewData["ProjectList"] as SelectList)</td>
                <td align="right" style="width:70px;">检验日期：</td>
                <td align="left" style="width:80px;"><input type="text" id="txt_StartTime" value="" onclick="WdatePicker()"  style="width:80px;"/></td>
                <td align="center" style="width:30px;">至</td>
                <td align="left" style="width:80px;"><input type="text" id="txt_EndTime" value="" onclick="WdatePicker()"  style="width:80px;"/></td>
                <td align="right"style="width:70px;">统计类型：</td>
                <td align="left" style="width:70px;"><input type="radio" name="Rio_ReportType" value="1" checked="checked" />折线图</td>
                <td align="left" style="width:70px;"><input type="radio" name="Rio_ReportType" value="2" />柱状图</td>
                <td width="60px"><a href="javascript:Report();"><img height="20px" src="/Content/Images/chaxun.png" /></a></td>
                <td align="right"></td>
            </tr>
        </table>

        <table cellpadding="0" cellspacing="1" class="MainTable">
            <tr>
                <td style="width:200px;">
                    <div class="SampleList">
                        <h2>样品列表</h2>
                        <ul>
                            @{
                                if (ViewData["SampleData"] != null && (ViewData["SampleData"] as System.Data.DataTable).Rows.Count > 0)
                                {
                                    System.Data.DataTable TempDt = (ViewData["SampleData"] as System.Data.DataTable);
                                    for (int i = 0; i < TempDt.Rows.Count; i++)
                                    {
                                        <li><input type="checkbox" value="@(TempDt.Rows[i]["SampleID"].ToString())" />@(TempDt.Rows[i]["SampleName"].ToString())</li>
                                    }
                                }
                              }
                        </ul>
                    </div>
                </td>
                <td valign="top">
                    <div id="container" style="width: 100%;height: 500px; margin: 0 auto;">
                                    
                    </div>
                </td>
            </tr>
        </table>
    </div>
</body>
